// 消息系统类型定义

export type MessageType = 'comment_reply' | 'movie_upload' | 'system' | 'like' | 'follow'

export interface Message {
  id: number
  recipient_id: string
  sender_id?: string
  type: MessageType
  title: string
  content: string
  related_movie_id?: number
  related_comment_id?: number
  is_read: boolean
  created_at: string
  updated_at: string
}

export interface MessageWithDetails extends Message {
  sender_name?: string
  sender_avatar?: string
  sender_is_ai?: boolean
  related_movie_title?: string
}

export interface MessageSettings {
  id: number
  user_id: string
  comment_replies: boolean
  movie_uploads: boolean
  system_notifications: boolean
  likes: boolean
  follows: boolean
  email_notifications: boolean
  created_at: string
  updated_at: string
}

export interface CreateMessageParams {
  recipient_id: string
  sender_id?: string
  type: MessageType
  title: string
  content: string
  related_movie_id?: number
  related_comment_id?: number
}

export interface UpdateMessageSettingsParams {
  comment_replies?: boolean
  movie_uploads?: boolean
  system_notifications?: boolean
  likes?: boolean
  follows?: boolean
  email_notifications?: boolean
}

export interface MessageListResponse {
  messages: MessageWithDetails[]
  total: number
  hasMore: boolean
}

export interface MessageResponse {
  success: boolean
  message?: string
  error?: string
  data?: any
}
